package ru.kipriz.todoly.api.dao.http;

import ru.kipriz.todoly.api.Parser;
import ru.kipriz.todoly.api.dao.FilterDao;
import ru.kipriz.todoly.api.entities.FilterObject;

import java.io.IOException;
import java.util.List;

/**
 * <p>Copyright: Copyright (c) 2010</p>
 *
 * @author Andrey Volkov
 *         <br/>Date: 12/24/10
 */
public class FilterDaoHttp implements FilterDao
{
    public List<FilterObject> getAll()
    {
        try
        {
            String response = WebRequest.get("filters.json");
            return Parser.parseListJson(FilterObject.class, response);
        } catch (IOException e)
        {
            return null;
        }
    }
}
